<?php

class Ialbum_Widget_ListOtherAlbumsController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
  	$this->getElement()->removeDecorator('Title');
  	if (!Engine_Api::_()->core()->hasSubject()) {
      return $this->setNoRender();
    }
    $this->view->subject = $subject = Engine_Api::_()->core()->getSubject();
    if(!($subject instanceof Album_Model_Album))
  	{
      return $this->setNoRender();
    }
  	//get other photo
	$this->view->paginator = $paginator = Engine_Api::_()->getApi('Album', 'Ialbum')->getAlbumPaginator(array(
      'owner' => $subject->getOwner(),
	  'search' => 1,
	  'album_ignore' => $subject->getIdentity()
    ));
     $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 3));
     $this->view->count = $count = $paginator->count();
	 if($count <= 0){
	    return $this->setNoRender();
	 }
  }
}
